$OpenBSD: patch-Makefile_in,v 1.7 2017/02/10 09:40:01 giovanni Exp $
--- Makefile.in.orig	Sat Jan 28 04:00:36 2017
+++ Makefile.in	Fri Feb 10 10:26:23 2017
@@ -688,7 +688,7 @@ CLEANFILES = authldaprc.h authmysqlrc.h authsqliterc.h
 
 DISTCLEANFILES = dbobj.config README_authlib.html
 commonlibdep = libcourierauthcommon.la
-commonldflags = -module -rpath $(pkglibdir) -export-symbols-regex 'courier_auth.*_init' -avoid-version
+commonldflags = -module -rpath $(pkglibdir) -export-symbols-regex 'courier_auth.*_init'
 commonlibadd = libcourierauthcommon.la
 libcourierauthcommon_t = @CRYPTLIBS@
 libcourierauthcommon_la_SOURCES = \
@@ -706,7 +706,7 @@ libcourierauthcommon_la_SOURCES = \
 
 libcourierauthcommon_la_DEPENDENCIES = libcourierauth.la
 libcourierauthcommon_la_LIBADD = libcourierauth.la
-libcourierauthcommon_la_LDFLAGS = $(libcourierauthcommon_t:%=-Wl,%) -avoid-version
+libcourierauthcommon_la_LDFLAGS = $(libcourierauthcommon_t:%=-Wl,%)
 libcourierauth_la_SOURCES = authdaemon.c authdaemonlib.c preauthdaemon.c \
 	authmoduser2.c authmoduser3.c debug.c \
 	courierauthdebug.h \
@@ -715,7 +715,7 @@ libcourierauth_la_SOURCES = authdaemon.c authdaemonlib
 libcourierauth_la_LIBADD = libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la libs/numlib/libnumlib.la \
 	libs/random128/librandom128.la libs/rfc822/libencode.la
 
-libcourierauth_la_LDFLAGS = @NETLIBS@ -avoid-version
+libcourierauth_la_LDFLAGS = @NETLIBS@
 
 # The userdb module
 libauthuserdb_t = userdb/libuserdb.la @dblibrary@ @LIBGDBM@ @LIBDB@
@@ -817,7 +817,7 @@ libcourierauthsasl_la_SOURCES = \
 	authsaslfrombase64.c authsasltobase64.c
 
 libcourierauthsasl_la_LIBADD = libcourierauthcommon.la libcourierauth.la
-libcourierauthsasl_la_LDFLAGS = -export-symbols-regex '^auth_sasl|auth_sasl_ex|auth_sasl_extract_userid$$' -avoid-version
+libcourierauthsasl_la_LDFLAGS = -export-symbols-regex '^auth_sasl|auth_sasl_ex|auth_sasl_extract_userid$$'
 libcourierauthsaslclient_la_SOURCES = courierauthsaslclient.h \
 	authsaslclient.c authsaslclient.h authsaslclientcram.c \
 	authsaslclientcrammd5.c authsaslclientcramsha1.c \
@@ -826,7 +826,7 @@ libcourierauthsaslclient_la_SOURCES = courierauthsaslc
 	authsaslfrombase64.c authsasltobase64.c
 
 libcourierauthsaslclient_la_LIBADD = libcourierauth.la
-libcourierauthsaslclient_la_LDFLAGS = -export-symbols-regex '^auth_sasl_client$$' -avoid-version
+libcourierauthsaslclient_la_LDFLAGS = -export-symbols-regex '^auth_sasl_client$$'
 include_HEADERS = courier_auth_config.h courierauth.h courierauthsasl.h \
 	courierauthsaslclient.h courierauthdebug.h courierauthstaticlist.h
 
@@ -859,7 +859,7 @@ authdaemondprog_LDADD = $(LIBLTDL) libcourierauthcommo
 	libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la \
 	libs/rfc822/libencode.la libs/numlib/libnumlib.la
 
-authdaemondprog_LDFLAGS = -export-dynamic $(modules:%=-dlopen %) @NETLIBS@
+authdaemondprog_LDFLAGS = -export-dynamic $(modules:%=-dlopen %) -lpthread @NETLIBS@
 authdaemontest_SOURCES = authdaemontest.c
 authdaemontest_DEPENDENCIES = libcourierauthcommon.la
 authdaemontest_LDADD = libcourierauthcommon.la @NETLIBS@
